#include <REGX52.H>
#include "LCD1602.h"
#include "Delay.h"
#include "Timer0.h"
#include "Int0.h"
#include "IR.h"

unsigned char DataFlag;
unsigned char RepeatFlag;
unsigned char Address;
unsigned char Command;
unsigned char Num;

void main()
{
	LCD_Init();
	IR_Init();
	LCD_ShowString(1,1,"AD  CM  NUM");
	
	
	while(1)
	{
		if(IR_GetDataFlag()||IR_GetRepeatFlag())
		{
			Address=IR_GetAddress();
			Command=IR_GetCommand();
			if(Command==IR_VOL_MINUS)
			{
				Num--;
			}
			if(Command==IR_VOL_ADD)
			{
				Num++;
			}
		}
		LCD_ShowHexNum(2,1,Address,2);
		LCD_ShowHexNum(2,5,Command,2);
		LCD_ShowNum(2,9,Num,3);
		
	}
}

